home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / Jogos de Azar / fruit.swf / scripts / C_LinesReelsCellCLASS.as < prev    next >
Text File  |  2006-01-17  |  3KB  |  122 lines

  1. _global.C_LinesReelsCellCLASS = function()
  2. {
  3.    this.init();
  4. };
  5. C_LinesReelsCellCLASS.prototype = new MovieClip();
  6. C_LinesReelsCellCLASS.prototype.init = function()
  7. {
  8.    this.lineStars_1 = [1];
  9.    this.lineStars_2 = [4,5];
  10.    this.lineStars_3 = [2,3];
  11.    this.lineStars_4 = [4,1,3];
  12.    this.lineStars_5 = [2,1,5];
  13.    this.lines = [];
  14.    this.linesNumbers = [];
  15.    var i = 1;
  16.    while(i <= this.nLines)
  17.    {
  18.       this["line_" + i + "_mc"].lines = this["lineStars_" + i];
  19.       this["line_" + i + "_mc"].show = function()
  20.       {
  21.          this._visible = 1;
  22.          var i = 0;
  23.          while(i < this.lines.length)
  24.          {
  25.             this._parent["S" + this.lines[i] + "_mc"]._visible = 1;
  26.             i++;
  27.          }
  28.       };
  29.       this["line_" + i + "_mc"].hide = function()
  30.       {
  31.          this._visible = 0;
  32.          var i = 0;
  33.          while(i < this.lines.length)
  34.          {
  35.             this._parent["S" + this.lines[i] + "_mc"]._visible = 0;
  36.             i++;
  37.          }
  38.       };
  39.       this.lines.push(this["line_" + i + "_mc"]);
  40.       this.linesNumbers.push(i);
  41.       i++;
  42.    }
  43.    this.hideAll();
  44. };
  45. C_LinesReelsCellCLASS.prototype.hideAll = function()
  46. {
  47.    var i = 0;
  48.    while(i < this.lines.length)
  49.    {
  50.       this.lines[i].hide();
  51.       i++;
  52.    }
  53. };
  54. C_LinesReelsCellCLASS.prototype.showAll = function()
  55. {
  56.    var i = 0;
  57.    while(i < this.lines.length)
  58.    {
  59.       this.lines[i].show();
  60.       i++;
  61.    }
  62. };
  63. C_LinesReelsCellCLASS.prototype.showLine = function(l)
  64. {
  65.    this.hideAll();
  66.    var o = this["line_" + l + "_mc"];
  67.    o.show();
  68.    return o;
  69. };
  70. C_LinesReelsCellCLASS.prototype.showLines = function(a)
  71. {
  72.    this.hideAll();
  73.    var i = 0;
  74.    while(i < a.length)
  75.    {
  76.       this["line_" + a[i] + "_mc"].show();
  77.       i++;
  78.    }
  79. };
  80. C_LinesReelsCellCLASS.prototype.blink = function(blinkArray)
  81. {
  82.    if(!blinkArray)
  83.    {
  84.       this.holder.removeMovieClip();
  85.       this.hideAll();
  86.       var i = 0;
  87.       while(i < this.lines.length)
  88.       {
  89.          this.lines[i]._alpha = 100;
  90.          i++;
  91.       }
  92.       return undefined;
  93.    }
  94.    this.hideAll();
  95.    var len = blinkArray.length;
  96.    var a = blinkArray;
  97.    var o = this.createEmptyMovieClip("holder",123);
  98.    o.n = 0;
  99.    o.onEnterFrame = function()
  100.    {
  101.       this.o = this._parent.showLine(a[this.n]);
  102.       this.o._alpha -= 10;
  103.       if(this.o._alpha >= 60)
  104.       {
  105.          return undefined;
  106.       }
  107.       this.o._alpha = 100;
  108.       this.n = this.n + 1;
  109.       if(this.n >= len)
  110.       {
  111.          this.n = 0;
  112.       }
  113.       this._parent.showLine(a[this.n]);
  114.    };
  115.    o.onUnload = function()
  116.    {
  117.       this.o._alpha = 100;
  118.    };
  119. };
  120. ASSetPropFlags(_global,"C_LinesReelsCellCLASS",131);
  121. Object.registerClass("C_LinesReelsCellCLASS",C_LinesReelsCellCLASS);
  122.